﻿/*----------------------------------------------------------------
    // Copyright (C) 2009 江苏华招网
    // 版权所有。 
    // 作者：宣帅
    //
    // 文件名：OrderConfirm.cs
    // 文件功能描述：订单确认界面
    // 创建标识：宣帅2009-05-12
    //
    // 修改标识： 
    // 修改描述： 
    //
    // 修改标识： 
    // 修改描述： 
    //
    // 审核人： 
    // 审核时间： 
    // 审核说明： 
 //----------------------------------------------------------------*/

using System;
using System.Collections;
using System.Configuration;
using System.Data;

using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using System.Collections.Generic;
using HZ.DrugTrade.Web;
using HZ.DrugTrade.Model;
using HZ.DrugTrade.IBLL;
using HZ.DrugTrade.BLLFactory;
using HZ.DrugTrade.Model.Enum;

namespace HZ.DrugTrade.Web.Enterprise.OrderManage
{
    public partial class OrderConfirm : BasePage
    {
        public OrderConfirm()
        {
            this.ModuleNo = Module.订单管理.ToString();
        }

        IBLL_Purchase I_Purchase = Factory.BLL_Purchase();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Bind();
            }
        }

        protected void btnQuery_Click(object sender, EventArgs e)
        {
            AspNetPager1.CurrentPageIndex = 1;
            Bind();
        }

        protected void Bind()
        { 
            HZ.DrugTrade.Model.Query.PurchaseOrder_NoConfirm aPurchaseOrder_NoConfirm = new HZ.DrugTrade.Model.Query.PurchaseOrder_NoConfirm();

            aPurchaseOrder_NoConfirm.StartTimeFrom = new HZ.Common.ConvertHelper(txtBegin.Text.Trim()).ToDateTime;
            aPurchaseOrder_NoConfirm.StartTimeTo = new HZ.Common.ConvertHelper(txtEnd.Text.Trim()).ToDateTime; 
            aPurchaseOrder_NoConfirm.HospitalName = this.txtHospitalName.Text.Trim();
            aPurchaseOrder_NoConfirm.OrderName = this.txtOrderName.Text.Trim();

            aPurchaseOrder_NoConfirm.CompanyID_PS = CurrentAccount.GetUser().Org.OrgID; //Program.Login_User.Org.OrgID;

            //aPurchaseOrder_NoConfirm.OrderStatus = 1;
            aPurchaseOrder_NoConfirm.SortFields = "PlanTime desc,OrderName ASC,HospitalName ASC";

            //AspNetPager1.PageSize = Constants.GRIDVIEW_PAGE_SIZE;
            int totalrecord = 0;
            try
            {
                gvwProduceCatalog.AutoGenerateColumns = false;
                gvwProduceCatalog.DataSource = I_Purchase.GetPurchaseOrder_NoConfirmByWhere(aPurchaseOrder_NoConfirm, this.AspNetPager1.CurrentPageIndex, this.AspNetPager1.PageSize, out totalrecord);
                gvwProduceCatalog.DataBind();
                this.AspNetPager1.RecordCount = totalrecord;
            }
            catch (Exception ex)
            {
                PageError(ex.Message, "");
            }
        }

        protected void AspNetPager1_OnPageChanged(object sender, EventArgs e)
        {
            Bind();
        }

        protected void btnConfirm_Click(object sender, EventArgs e)
        {

        }
    }
}
